# -*- coding: utf-8 -*-            
# @Time : 2025/5/8 23:50
# @Author: ZZC
# @proj: BERT_NO1
# 测试功能

# https://blog.csdn.net/gitblog_00592/article/details/141316093
# from transformers import BertTokenizer, BertForSequenceClassification
# # 加载 BERTweet 模型和分词器
# model_name = "./bertweet-base"
# tokenizer = BertTokenizer.from_pretrained(model_name)
# model = BertForSequenceClassification.from_pretrained(model_name)

import torch
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("../bertweet-base")

tokenizer = AutoTokenizer.from_pretrained("../bertweet-base")

# 示例文本
# text = "Tôi rất thích sử dụng BERTweet cho việc phân tích cảm xúc trên Twitter."
text = "you are stupid."

# 编码文本
inputs = tokenizer(text, return_tensors="pt")

# 模型预测
outputs = model(**inputs)
# logits = outputs.logits
# predictions = logits.argmax(dim=-1)

# print(f"预测类别: {predictions.item()}")
if __name__ == '__main__':
    pass
